<span class="switch">
    <? foreach(Locale::languages() as $k=>$v): ?>
        <?= $this->link($v, sprintf($link, $k), array(
            'class' => $k . ($k == $lang ? ' selected' : '')
        )) ?>
    <? endforeach ?>
</span>